home *** CD-ROM | disk | FTP | other *** search
/ You're the Director / You're The Director.iso / pc / pcf / df.dir / 00001.ls next >
Encoding:
Text File  |  1995-10-08  |  14.5 KB  |  610 lines

  1. on startMovie
  2.   global max, movielist, limit, splist, reset, letgo, exitFrame, gSound, prev, gCurrentSprite, Double, Increment, Loudness
  3.   set Loudness to the soundLevel
  4.   set Increment to 1
  5.   set Double to 0
  6.   set gCurrentSprite to 3
  7.   set prev to 0
  8.   set gSound to 6
  9.   set prev to 0
  10.   set letgo to 0
  11.   set reset to 0
  12.   set the visible of sprite 19 to 0
  13.   updateStage()
  14.   set magcursor to [the number of cast "Clapboard"]
  15.   set the cursor of sprite 1 to magcursor
  16.   set the textSize of field "movie" to 24
  17.   set the textSize of field "name" to 24
  18.   repeat with i = 21 to 45
  19.     puppetSprite(i, 1)
  20.   end repeat
  21.   set the visible of sprite 45 to 0
  22.   initsel()
  23.   set splist to [[195, 211], [195, 294], [195, 377], [443, 211], [443, 294], [443, 377]]
  24.   set limit to 24
  25.   set movielist to []
  26.   hidebar()
  27.   set max to count(movielist)
  28.   when keyDown then globalkey
  29.   puppetSprite(48, 1)
  30.   set the visible of sprite 48 to 0
  31.   updateStage()
  32.   go("Options")
  33.   updateStage()
  34. end
  35.  
  36. on testbut
  37.   global movielist
  38.   if count(movielist) <= 0 then
  39.     repeat with i = 12 to 18
  40.       set the visible of sprite i to 0
  41.     end repeat
  42.   else
  43.     repeat with i = 12 to 18
  44.       set the visible of sprite i to 1
  45.     end repeat
  46.   end if
  47. end
  48.  
  49. on setdef
  50.   repeat with i = 12 to 18
  51.     set the visible of sprite i to 1
  52.   end repeat
  53. end
  54.  
  55. on addbar x
  56.   global letgo, movielist
  57.   put "inside addbar"
  58.   if count(movielist) >= 24 then
  59.     exit
  60.   end if
  61.   set letgo to 0
  62.   set yu to string(item 1 of the name of cast the castNum of sprite x)
  63.   add(movielist, yu)
  64.   set max to count(movielist)
  65.   reset()
  66.   setbar()
  67. end
  68.  
  69. on addbarC x
  70.   global letgo, movielist
  71.   if count(movielist) >= 24 then
  72.     exit
  73.   end if
  74.   set letgo to 0
  75.   set vu to the number of cast string(chars(the name of cast the castNum of sprite x, 1, 2) & "s")
  76.   set yu to string(item 1 of the name of cast vu)
  77.   add(movielist, yu)
  78.   set max to count(movielist)
  79.   set the castNum of sprite (20 + max) to vu
  80.   updateStage()
  81.   showbar()
  82.   reset()
  83. end
  84.  
  85. on showbar
  86.   global movielist, max, limit
  87.   set the visible of sprite 2 to 1
  88.   repeat with i = 21 to 20 + count(movielist)
  89.     set the visible of sprite i to 1
  90.   end repeat
  91.   repeat with i = 20 + count(movielist) + 1 to 20 + limit
  92.     set the visible of sprite i to 0
  93.   end repeat
  94.   updateStage()
  95. end
  96.  
  97. on showbarB
  98.   global movielist, max, limit
  99.   set the visible of sprite 2 to 1
  100.   repeat with i = 21 to 20 + count(movielist)
  101.     set the visible of sprite i to 1
  102.   end repeat
  103.   repeat with i = 20 + count(movielist) + 1 to 20 + limit
  104.     set the visible of sprite i to 0
  105.   end repeat
  106. end
  107.  
  108. on hidebar
  109.   global movielist, max, limit
  110.   if the frame > 18 then
  111.     set the visible of sprite 2 to 0
  112.   end if
  113.   repeat with i = 21 to 20 + limit
  114.     set the visible of sprite i to 0
  115.   end repeat
  116.   updateStage()
  117. end
  118.  
  119. on setbar
  120.   global movielist, max, selected, limit, Double
  121.   put "inside setbar"
  122.   if count(movielist) = 0 then
  123.     repeat with i = 21 to 20 + limit
  124.       set the visible of sprite i to 0
  125.     end repeat
  126.     exit
  127.   end if
  128.   repeat with i = 1 to count(movielist)
  129.     set the castNum of sprite (20 + i) to the number of cast string(getAt(movielist, i))
  130.   end repeat
  131.   repeat with i = 1 to count(selected)
  132.     if getAt(selected, i) = 1 then
  133.       if Double = 0 then
  134.         set the ink of sprite (20 + i) to 4
  135.         put "above puppetSprite 45 is true"
  136.         puppetSprite(45, 1)
  137.         set the moveableSprite of sprite 45 to 1
  138.         set newsprite to 20 + i
  139.         set the locH of sprite 45 to the locH of sprite newsprite
  140.         set the locV of sprite 45 to the locV of sprite newsprite
  141.         set the visible of sprite 45 to 1
  142.         set the moveableSprite of sprite 45 to 0
  143.         updateStage()
  144.       end if
  145.       next repeat
  146.     end if
  147.     set the ink of sprite (20 + i) to 0
  148.   end repeat
  149.   if Double = 0 then
  150.     showbar()
  151.   end if
  152. end
  153.  
  154. on setbarB
  155.   global movielist, max, selected, limit, Double
  156.   put "inside setbar"
  157.   if count(movielist) = 0 then
  158.     repeat with i = 21 to 20 + limit
  159.       set the visible of sprite i to 0
  160.     end repeat
  161.     exit
  162.   end if
  163.   repeat with i = 1 to count(movielist)
  164.     set the castNum of sprite (20 + i) to the number of cast string(getAt(movielist, i))
  165.   end repeat
  166.   repeat with i = 1 to count(selected)
  167.     if getAt(selected, i) = 1 then
  168.       if Double = 0 then
  169.         set the ink of sprite (20 + i) to 4
  170.         put "above puppetSprite 45 is true"
  171.         puppetSprite(45, 1)
  172.         set the moveableSprite of sprite 45 to 1
  173.         set newsprite to 20 + i
  174.         set the locH of sprite 45 to the locH of sprite newsprite
  175.         set the locV of sprite 45 to the locV of sprite newsprite
  176.         set the visible of sprite 45 to 1
  177.         set the moveableSprite of sprite 45 to 0
  178.       end if
  179.       next repeat
  180.     end if
  181.     set the ink of sprite (20 + i) to 0
  182.   end repeat
  183.   if Double = 0 then
  184.     showbarB()
  185.   end if
  186. end
  187.  
  188. on namesmall
  189.   set x1 to 100
  190.   repeat with i = 1 to 36
  191.     set yur to numToChar(charToNum("`") + (i / 6) + 1)
  192.     set the name of cast (i + x1) to string(yur & i mod 6) & "s"
  193.     if (i mod 6) = 0 then
  194.       set the name of cast (i + x1) to string(numToChar(charToNum(yur) - 1) & "6") & "s"
  195.     end if
  196.   end repeat
  197. end
  198.  
  199. on namemov
  200.   set x1 to 136
  201.   repeat with i = 1 to 36
  202.     set yur to numToChar(charToNum("`") + (i / 6) + 1)
  203.     set the name of cast (i + x1) to string(yur & i mod 6) & ".mov"
  204.     if (i mod 6) = 0 then
  205.       set the name of cast (i + x1) to string(numToChar(charToNum(yur) - 1) & "6") & ".mov"
  206.     end if
  207.   end repeat
  208. end
  209.  
  210. on initsp
  211.   global splist
  212.   set splist to []
  213.   set x to 3
  214.   repeat with i = x to x + 5
  215.     add(splist, [the locH of sprite i, the locV of sprite i])
  216.   end repeat
  217. end
  218.  
  219. on reset
  220.   global splist, reset
  221.   if the frame = 56 then
  222.     exit
  223.   end if
  224.   set x to 13
  225.   repeat with i = x to x + 5
  226.     set yu to getAt(splist, i - x + 1)
  227.     set the locH of sprite i to getAt(yu, 1)
  228.     set the locV of sprite i to getAt(yu, 2)
  229.     set the castNum of sprite i to the number of cast string(chars(the name of cast the castNum of sprite i, 1, 2))
  230.     set the ink of sprite i to 0
  231.     updateStage()
  232.   end repeat
  233.   updateStage()
  234. end
  235.  
  236. on playmovn
  237.   set yu to the clickOn
  238.   puppetSprite(48, 1)
  239.   set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  240.   set the visible of sprite 48 to 1
  241.   set the movieTime of sprite 48 to 0
  242.   set the movieRate of sprite 48 to 1
  243.   repeat while (the movieTime of sprite 48 < the duration of cast the castNum of sprite 48) and the controlDown
  244.     updateStage()
  245.   end repeat
  246.   set the movieTime of sprite 48 to 0
  247.   set the movieRate of sprite 48 to 0
  248.   set the visible of sprite 48 to 0
  249. end
  250.  
  251. on playmovn2
  252.   set yu to the clickOn
  253.   puppetSprite(48, 1)
  254.   set yu to 0
  255.   repeat with i = 1 to count(movielist)
  256.     if getAt(selected, i) = 1 then
  257.       set yu to i
  258.     end if
  259.     if yu <> 0 then
  260.       exit repeat
  261.     end if
  262.   end repeat
  263.   if yu = 0 then
  264.     exit
  265.   end if
  266.   set yu to yu + 20
  267.   set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  268.   set the visible of sprite 48 to 1
  269.   updateStage()
  270.   set the movieTime of sprite 48 to 0
  271.   set the movieRate of sprite 48 to 1
  272.   updateStage()
  273.   repeat while (the movieTime of sprite 48 < the duration of cast the castNum of sprite 48) and not (the controlDown)
  274.     updateStage()
  275.   end repeat
  276.   set the movieTime of sprite 48 to 0
  277.   set the movieRate of sprite 48 to 0
  278.   set the visible of sprite 48 to 0
  279.   updateStage()
  280.   repeat with x = 13 to 18
  281.     set the visible of sprite x to 1
  282.   end repeat
  283.   updateStage()
  284. end
  285.  
  286. on playmovn3
  287.   global prev
  288.   if prev = 1 then
  289.     set yu to the clickOn
  290.     puppetSprite(48, 1)
  291.     set yu to 0
  292.     repeat with i = 1 to count(movielist)
  293.       if getAt(selected, i) = 1 then
  294.         set yu to i
  295.         set the visible of sprite 19 to 1
  296.         puppetSound(0)
  297.         updateStage()
  298.       end if
  299.       if yu <> 0 then
  300.         exit repeat
  301.       end if
  302.     end repeat
  303.     if yu = 0 then
  304.       set prev to 0
  305.       exit
  306.     end if
  307.     set yu to yu + 20
  308.     set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  309.     set the visible of sprite 48 to 1
  310.     updateStage()
  311.     set the movieTime of sprite 48 to 0
  312.     set the movieRate of sprite 48 to 1
  313.     updateStage()
  314.     set prev to 2
  315.   end if
  316.   if (the movieTime of sprite 48 < the duration of cast the castNum of sprite 48) and not (the controlDown) then
  317.     updateStage()
  318.   else
  319.     set prev to 0
  320.     set the movieTime of sprite 48 to 0
  321.     set the movieRate of sprite 48 to 0
  322.     set the visible of sprite 48 to 0
  323.     updateStage()
  324.     set the visible of sprite 19 to 0
  325.     repeat with x = 13 to 18
  326.       set the visible of sprite x to 1
  327.     end repeat
  328.     repeat with x = 3 to 8
  329.       puppetSprite(x, 1)
  330.       set the visible of sprite x to 1
  331.       puppetSprite(x, 0)
  332.     end repeat
  333.     puppetSprite(20, 1)
  334.     set the visible of sprite 20 to 1
  335.     puppetSprite(20, 0)
  336.     puppetSound("OPEN.AIF")
  337.     play done
  338.     updateStage()
  339.   end if
  340. end
  341.  
  342. on playmovn4 yu
  343.   global k, mm
  344.   set yu to yu + 20
  345.   set i to chars(the name of cast the castNum of sprite yu, 1, 3)
  346.   set place to getOne(movielist, i)
  347.   set k to place
  348.   set mm to place
  349.   set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  350.   set the visible of sprite 48 to 1
  351.   updateStage()
  352.   set the movieTime of sprite 48 to 0
  353.   set the movieRate of sprite 48 to 1
  354.   updateStage()
  355. end
  356.  
  357. on initsel
  358.   global selected
  359.   set selected to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  360. end
  361.  
  362. on delset
  363.   global selected, movielist
  364.   if count(movielist) <= 0 then
  365.     exit
  366.   end if
  367.   set sel to countsel()
  368.   if sel = 0 then
  369.     exit
  370.   end if
  371.   set del to []
  372.   repeat with i = 1 to count(movielist)
  373.     if getAt(selected, i) = 1 then
  374.       setAt(movielist, i, 0)
  375.     end if
  376.   end repeat
  377.   put del
  378.   set mv2 to []
  379.   repeat with i in movielist
  380.     if i <> 0 then
  381.       add(mv2, i)
  382.     end if
  383.   end repeat
  384.   set movielist to mv2
  385.   set the visible of sprite 45 to 0
  386.   updateStage()
  387.   initsel()
  388.   setbar()
  389. end
  390.  
  391. on plusset
  392.   global selected, movielist
  393.   if count(movielist) <= 0 then
  394.     exit
  395.   end if
  396.   set sel to countsel()
  397.   if (sel = count(movielist)) or (sel = 0) then
  398.     exit
  399.   end if
  400.   initsel()
  401.   setAt(selected, sel, 1)
  402.   repeat with i = count(movielist) - 1 down to 1
  403.     if getAt(selected, i) = 1 then
  404.       set yut to getAt(movielist, i)
  405.       setAt(movielist, i, getAt(movielist, i + 1))
  406.       setAt(movielist, i + 1, yut)
  407.       deleteAt(selected, count(selected))
  408.       addAt(selected, 1, 0)
  409.       exit repeat
  410.     end if
  411.   end repeat
  412.   put "inside plusset"
  413.   setbar()
  414. end
  415.  
  416. on minset
  417.   global selected, movielist
  418.   if count(movielist) <= 0 then
  419.     exit
  420.   end if
  421.   if getAt(selected, 1) = 1 then
  422.     exit
  423.   end if
  424.   set sel to countsel()
  425.   if sel = 0 then
  426.     exit
  427.   end if
  428.   initsel()
  429.   setAt(selected, sel, 1)
  430.   repeat with i = 1 to count(movielist)
  431.     if getAt(selected, i) = 1 then
  432.       set yut to getAt(movielist, i)
  433.       deleteAt(movielist, i)
  434.       add(movielist, i - 1, yut)
  435.       deleteAt(selected, 1)
  436.       add(selected, 0)
  437.       exit repeat
  438.     end if
  439.   end repeat
  440.   put "inside minset"
  441.   setbar()
  442. end
  443.  
  444. on countsel
  445.   repeat with i = 1 to count(selected)
  446.     if getAt(selected, i) = 1 then
  447.       return i
  448.       exit
  449.     end if
  450.   end repeat
  451.   return 0
  452. end
  453.  
  454. on clearall
  455.   global movielist
  456.   set movielist to []
  457.   set the visible of sprite 45 to 0
  458.   initsel()
  459.   put "inside clearall"
  460.   setbar()
  461. end
  462.  
  463. on globalkey
  464.   if the key = BACKSPACE then
  465.     delset()
  466.   end if
  467.   if the key = "+" then
  468.     plusset()
  469.   end if
  470.   if the key = "-" then
  471.     minset()
  472.   end if
  473. end
  474.  
  475. on compilemov
  476.   global movielist, comp, k, mm, Double
  477.   if k = 0 then
  478.     puppetSprite(48, 1)
  479.     set k to 0
  480.     set mm to 1
  481.   end if
  482.   if k <> mm then
  483.     set k to mm
  484.     if k <= count(movielist) then
  485.       set i to getAt(movielist, k)
  486.       initsel()
  487.       setAt(selected, k, 1)
  488.       if Double = 0 then
  489.         setbar()
  490.       end if
  491.       put "just after set bar"
  492.       set j to chars(i, 1, 2)
  493.       set Dump to the castNum of sprite 48
  494.       set the castNum of sprite 48 to the number of cast (j & ".mov")
  495.       unLoadCast(Dump)
  496.       set the directToStage of cast the castNum of sprite 48 to 1
  497.       set the visible of sprite 48 to 1
  498.       updateStage()
  499.       set the movieTime of sprite 48 to 0
  500.       set the movieRate of sprite 48 to 1
  501.       updateStage()
  502.     else
  503.       set the visible of sprite 48 to 0
  504.       puppetSprite(48, 0)
  505.       set comp to 0
  506.       set k to 0
  507.       puppetSprite(1, 0)
  508.       set Double to 0
  509.       setbarB()
  510.       go("EndMovie")
  511.     end if
  512.   end if
  513.   if the movieTime of sprite 48 < the duration of cast the castNum of sprite 48 then
  514.     updateStage()
  515.   else
  516.     set the movieRate of sprite 48 to 0
  517.     set mm to mm + 1
  518.   end if
  519. end
  520.  
  521. on quitmov
  522.   global comp, k, m
  523.   set the visible of sprite 48 to 0
  524.   puppetSprite(48, 0)
  525.   set comp to 0
  526.   set k to 0
  527. end
  528.  
  529. on RunOff
  530.   global gCurrentSprite
  531.   set the editableText of sprite gCurrentSprite to 0
  532.   if gCurrentSprite = 3 then
  533.     set gCurrentSprite to 4
  534.     updateStage()
  535.   else
  536.     set gCurrentSprite to 3
  537.     testbut()
  538.     setdef()
  539.     go("no")
  540.     showbar()
  541.   end if
  542. end
  543.  
  544. on beginMyMovie
  545.   global myWindow
  546.   if objectp(myWindow) then
  547.     forget(myWindow)
  548.   end if
  549.   set horzOrigin to the stageLeft
  550.   set vertOrigin to the stageTop
  551.   set myWindowRect to rect(horzOrigin, vertOrigin, horzOrigin + 640, vertOrigin + 480)
  552.   set myWindow to window "HelpMovie"
  553.   set the rect of myWindow to myWindowRect
  554.   set the fileName of myWindow to "HLP.DIR"
  555.   set the titleVisible of myWindow to 0
  556.   open(myWindow)
  557.   tell window "HelpMovie"
  558.     go("Fstart")
  559.   end tell
  560. end
  561.  
  562. on finishMovie
  563.   global myWindow
  564.   if objectp(myWindow) then
  565.     forget(myWindow)
  566.   end if
  567. end
  568.  
  569. on MovieOver
  570.   global myWindow
  571.   if objectp(myWindow) then
  572.     forget(myWindow)
  573.   end if
  574. end
  575.  
  576. on DoubleScreen
  577.   global Double
  578.   if Double = 0 then
  579.     if the visible of sprite 48 = 1 then
  580.       set MovHt to 480
  581.       set MovWd to 640
  582.       set the height of sprite 48 to MovHt
  583.       set the width of sprite 48 to MovWd
  584.       set Back to the locV of sprite 1
  585.       set Back to Back + 1
  586.       puppetSprite(1, 1)
  587.       set the moveableSprite of sprite 1 to 1
  588.       set the locV of sprite 1 to Back
  589.       set the moveableSprite of sprite 1 to 0
  590.       puppetSprite(1, 0)
  591.       updateStage()
  592.       set Double to 1
  593.     end if
  594.   end if
  595. end
  596.  
  597. on HalfScreen
  598.   global Double
  599.   put "inside double mouseup"
  600.   if Double = 1 then
  601.     set Back to the locV of sprite 1
  602.     set Back to Back - 1
  603.     set the locV of sprite 1 to Back
  604.     set the height of sprite 48 to 240
  605.     set the width of sprite 48 to 320
  606.     updateStage()
  607.     set Double to 0
  608.   end if
  609. end
  610.